package com.sgb.goods.widget.pop;

import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.BitmapDrawable;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

import com.sgb.goods.R;
import com.sgb.goods.entity.order.OrderPayDetailEntity;
import com.sgb.goods.utils.base.adapter.BaseCommonAdapter;
import com.sgb.goods.view.adapter.order.PaymentAgreementAdapter;
import com.swgk.core.dialog.PopViewHolder;
import com.swgk.core.util.ResolutionUtil;

import java.util.List;

/**
 * 商品订单-付款（收款）约定弹窗
 *
 * @author qiangHeNoo
 * <p>
 * 时间：2021.12.20
 */
public class PaymentAgreementPop extends SimpleTile1Pop<OrderPayDetailEntity> {

    public PaymentAgreementPop(Context context) {
        super(context);
    }

    private PaymentAgreementAdapter adapter;

    @Override
    protected BaseCommonAdapter<OrderPayDetailEntity> getAdapter() {
        return null == adapter ? adapter = new PaymentAgreementAdapter(R.layout.goods_item_order_payment_agreement) : adapter;
    }

    @Override
    protected void initView(PopViewHolder holder) {
        super.initView(holder);
        mTitle.setText("付款约定");
    }

    public void showPop(View view, List<OrderPayDetailEntity> entityList) {
        adapter.setNewData(entityList);
        if (entityList == null || entityList.size() == 0) {
            viewStub.setVisibility(View.VISIBLE);
        }
        super.showDownPopwindow(view, true);
    }

}
